package com.flying.server.protocol;

import org.jboss.netty.channel.Channel;

import com.flying.utils.TimeUtil;

public class UserSession {
	
	/**
	 * SessionKey
	 */
	private String sessionID;
	/**
	 * 最后活动时间
	 */
	private long lastActivityTime = 0;
	/**
	 * 最后消息类型
	 */
	private int lastMsgType = 0;
	/**
	 * 消息管道对象
	 */
	private Channel channel = null;
	
	public UserSession(String sessionID)
	{
		this(sessionID,null);
	}
	
	public UserSession(String sessionID,Channel channel)
	{
		this.sessionID = sessionID;
		this.channel = channel;
		this.lastActivityTime = TimeUtil.getCurMillsTime();
	}
	
	public String getSessionID()
	{
		return sessionID;
	}
	
	public long getLastActivityTime()
	{
		return lastActivityTime;
	}
	
	public Channel getChannel()
	{
		return channel;
	}
	
	public int getLastMsgType()
	{
		return lastMsgType;
	}
	
	public void setLastMsgType(int msgType)
	{
		lastMsgType = msgType;
	}
}
